package stockticker.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OrderBy;
import javax.persistence.OrderColumn;
import javax.persistence.Table;

import org.hibernate.annotations.Entity;

@Entity
@Table (name="my_stocks")
@Inheritance (strategy=InheritanceType.SINGLE_TABLE)
public class MyStocks implements Serializable {
	private MyStockId id;
	private BigDecimal tradePrice;
	private Character tradeType;
	
	@EmbeddedId
	@AttributeOverrides ({@AttributeOverride (name="symbol", column=@Column (name="SYMBOL", unique=false, length=5, nullable=false, insertable=true, updatable=true)),
						  @AttributeOverride (name="tradeDateTime", column=@Column (name="TRADE_DATE_TIME", unique=false, nullable=false, insertable=true, updatable=true)),
						  @AttributeOverride (name="quantity", column=@Column (name="QUANTITY", unique=false, length=10, nullable=false, insertable=true, updatable=true))})
	public MyStockId getId() {
		return id;
	}
	public void setId(MyStockId id) {
		this.id = id;
	}
	@Column (name="TRADE_PRICE", unique=false, nullable=false, insertable=true, updatable=true)
	public BigDecimal getTradePrice() {
		return tradePrice;
	}
	public void setTradePrice(BigDecimal tradePrice) {
		this.tradePrice = tradePrice;
	}
	@Column (name="TRADE_TYPE", unique=false, length=1, nullable=false, insertable=true, updatable=true)
	public Character getTradeType() {
		return tradeType;
	}
	public void setTradeType(Character tradeType) {
		this.tradeType = tradeType;
	}
}
